package com.hnjd.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hnjd.entity.Tops;
import com.hnjd.service.ItopsService;
import com.hnjd.util.PageUtil;

@Controller
@RequestMapping("admin")
public class TopsCtontroller {

	
	@Autowired
	private ItopsService ts;
	
	
	@RequestMapping("topSave.do")
	public String topSave(Integer goodId,Integer type) {
		
		Tops top=new Tops();
		
		top.setGoodId(goodId);
		top.setType(type);
		System.out.println(top);
		 ts.topSave(top);
		
		 return "goodList.do";
	}
	 
	@RequestMapping("topDelete.do")
	public String  topDelete(Integer goodId) {
		
		ts.topDelete(goodId);
		return "goodList.do";
	}
	
}
